package com.mbc.web.common.client;

import java.util.Date;
import java.util.List;

import com.google.gwt.core.shared.GWT;
import com.google.gwt.user.client.rpc.AsyncCallback;
import com.mbc.common.data.CurrencyReferenceData;
import com.mbc.common.data.UserData;
import com.mbc.common.entities.Branch;
import com.mbc.common.entities.BranchRpt;
import com.mbc.common.entities.BranchType;
import com.mbc.common.entities.BranchTypeRpt;
import com.mbc.common.entities.Country;
import com.mbc.common.entities.CountryRpt;
import com.mbc.common.entities.Currency;
import com.mbc.common.entities.CurrencyRate;
import com.mbc.common.entities.CurrencyRateDetail;
import com.mbc.common.entities.CurrencyRateRpt;
import com.mbc.common.entities.CurrencyRpt;
import com.mbc.common.entities.Role;
import com.mbc.common.entities.SystemProperty;
import com.mbc.common.entities.User;
import com.mbc.common.param.CriteriaParams;
import com.mbc.web.common.client.controller.WebAccessController;
import com.mbc.web.common.client.controller.WebAccessControllerAsync;
import com.mbc.web.common.client.controller.WebCommonContoller;
import com.mbc.web.common.client.controller.WebCommonContollerAsync;
import com.mbc.web.common.shared.dto.AppItemListDTO;
import com.mbc.web.common.shared.dto.BranchChangeLogDataListDTO;
import com.mbc.web.common.shared.dto.BranchDataListDTO;
import com.mbc.web.common.shared.dto.BranchListDTO;
import com.mbc.web.common.shared.dto.BranchTypeDataListDTO;
import com.mbc.web.common.shared.dto.BranchViewLoadDTO;
import com.mbc.web.common.shared.dto.CountryDataListDTO;
import com.mbc.web.common.shared.dto.CurrencyDataListDTO;
import com.mbc.web.common.shared.dto.CurrencyRateDataListDTO;
import com.mbc.web.common.shared.dto.CurrencyRateViewLoadDTO;
import com.mbc.web.common.shared.dto.LevelAppItemListDTO;
import com.mbc.web.common.shared.dto.RoleDataListDTO;
import com.mbc.web.common.shared.dto.RoleListDTO;
import com.mbc.web.common.shared.dto.UserDataListDTO;
import com.mbc.web.common.shared.dto.UserViewLoadDTO;

public class CommonControllerMgr {
	
	private static WebCommonContollerAsync commonControllerAsync = GWT.create(WebCommonContoller.class);
	private static WebAccessControllerAsync accessControllerAsync = GWT.create(WebAccessController.class);
	
	public static void login(String loginID, String password, String dsName, AsyncCallback<UserData> callback){commonControllerAsync.login(loginID, password, dsName, callback);}
	public static void logout(AsyncCallback<Integer> callback){commonControllerAsync.logout(callback);}
	public static void getDSNames(AsyncCallback<List<String[]>> callback){commonControllerAsync.getDSNames(callback);}
	public static void getAllAppItems(AsyncCallback<AppItemListDTO> callback){commonControllerAsync.getAllAppItems(callback);}
	
	//SystemProperty
	public static void getSystemProperty(String key, AsyncCallback<SystemProperty> callback){commonControllerAsync.getSystemProperty(key, callback);}
	//End SystemProperty
	
	//Office
	public static void getAllBranch(AsyncCallback<BranchListDTO> callback){commonControllerAsync.getAllBranch(callback);}
	//End Office
	
	//User
	public static void createUser(User user, AsyncCallback<Integer> callback){accessControllerAsync.createUser(user, callback);}
	public static void updateUser(User user, AsyncCallback<Integer> callback){accessControllerAsync.updateUser(user, callback);}
	public static void deleteUser(long userID, AsyncCallback<Integer> callback){accessControllerAsync.deleteUser(userID, callback);}
	public static void getUserList(CriteriaParams cri, AsyncCallback<UserDataListDTO> callback){accessControllerAsync.getUserList(cri, callback);}
	public static void getUser(long userId, AsyncCallback<User> callback){accessControllerAsync.getUser(userId, callback);}
	public static void findUserByLoginId(String loginId, AsyncCallback<User> callback){accessControllerAsync.findUserByLoginId(loginId, callback);}
	public static void getUserViewLoadData(AsyncCallback<UserViewLoadDTO> callback){accessControllerAsync.getUserViewLoadData(callback);}
	public static void resetLoginPassword(String oldPassword, String newPassword, AsyncCallback<Integer> callback){accessControllerAsync.resetLoginPassword(oldPassword, newPassword, callback);}
	public static void changeUserBranch(String loginId, long branchId, AsyncCallback<Integer> callback){accessControllerAsync.changeUserBranch(loginId, branchId, callback);}
	public static void findUserBranchChangeLogs(CriteriaParams cri, AsyncCallback<BranchChangeLogDataListDTO> callback){accessControllerAsync.findUserBranchChangeLogs(cri, callback);}
	//end User
	
	//Role
	public static void createRole(Role role, AsyncCallback<Integer> callback){accessControllerAsync.createRole(role, callback);}
	public static void updateRole(Role role, AsyncCallback<Integer> callback){accessControllerAsync.updateRole(role, callback);}
	public static void deleteRole(long roleId, AsyncCallback<Integer> callback){accessControllerAsync.deleteRole(roleId, callback);}
	public static void findRole(long roleId, AsyncCallback<Role> callback){accessControllerAsync.findRole(roleId, callback);}
	public static void getAllRole(AsyncCallback<RoleListDTO> callback){accessControllerAsync.getAllRole(callback);}
	public static void getRoleList(CriteriaParams cri,AsyncCallback<RoleDataListDTO> callback){accessControllerAsync.getRoleList(cri, callback);}
	public static void getLevelAppItemByRoleId(long roleId, AsyncCallback<LevelAppItemListDTO> callback){accessControllerAsync.getLevelAppItemByRoleId(roleId, callback);}
	//End Role
	
	//Currency
	public static void createCurrency(Currency currency, AsyncCallback<Integer> callback){commonControllerAsync.createCurrency(currency, callback);}
	public static void updateCurrency(Currency currency, AsyncCallback<Integer> callback){commonControllerAsync.updateCurrency(currency, callback);}
	public static void deleteCurrency(long currencyId, AsyncCallback<Integer> callback){commonControllerAsync.deleteCurrency(currencyId, callback);}
	public static void getCurrencyList(Currency cri, AsyncCallback<CurrencyDataListDTO> callback){commonControllerAsync.getCurrencyList(cri, callback);}
	public static void getAllCurrency(AsyncCallback<List<CurrencyReferenceData>> callback){commonControllerAsync.getAllCurrency(callback);}
	public static void viewCurrencyReport(String fromCode, String toCode, AsyncCallback<Integer> callback){commonControllerAsync.viewCurrencyReport(fromCode, toCode, callback);}
	public static void prepareCurrencyReport(CurrencyRpt info,
			AsyncCallback<Integer> callback) {
		commonControllerAsync.prepareCurrencyReport(info, callback);}
	public static void findCurrencyByCode(String code, AsyncCallback<Currency> Callback) {commonControllerAsync.findCurrencyByCode(code, Callback);}
	//End Currency
	
	//Currency Rate
	public static void createCurrencyRate(CurrencyRate currencyRate, AsyncCallback<Integer> callback){commonControllerAsync.createCurrencyRate(currencyRate, callback);}
	public static void updateCurrencyRate(CurrencyRate currencyRate, AsyncCallback<Integer> callback){commonControllerAsync.updateCurrencyRate(currencyRate, callback);}
	public static void deleteCurrencyRate(long key, AsyncCallback<Integer> callback){commonControllerAsync.deleteCurrencyRate(key, callback);}
	public static void findCurrencyRate(long key, AsyncCallback<CurrencyRate> callback){commonControllerAsync.findCurrencyRate(key, callback);}
	public static void findCurrencyRates(CurrencyRate params, AsyncCallback<CurrencyRateDataListDTO> callback){commonControllerAsync.findCurrencyRates(params, callback);}
	public static void findLatestDetail(long currencyRateId, AsyncCallback<CurrencyRateDetail> callback){commonControllerAsync.findLatestDetail(currencyRateId, callback);}
	public static void findLatestDetail(long sourceCurrencyId, long convertCurrencyId, AsyncCallback<CurrencyRateDetail> callback){commonControllerAsync.findLatestDetail(sourceCurrencyId, convertCurrencyId, callback);}
	public static void getCurrencyRateViewLoadDTO(AsyncCallback<CurrencyRateViewLoadDTO> callback){commonControllerAsync.getCurrencyRateViewLoadDTO(callback);}
	public static void prepareCurrencyRateReport(CurrencyRateRpt info,AsyncCallback<Integer> callback) { commonControllerAsync.prepareCurrencyRateReport(info, callback);}
	public static void getSourcetoHomeRate(long source_currency, AsyncCallback<CurrencyRate> callback){commonControllerAsync.getSourcetoHomeRate(source_currency, callback);}
	public static void findCurrencyRateByCode(String code, AsyncCallback<CurrencyRate> Callback) {commonControllerAsync.findCurrencyRateByCode(code, Callback);}
	//End Currency Rate
	
	//Office
	public static void createBranch(Branch branch, AsyncCallback<Integer> callback){commonControllerAsync.createBranch(branch, callback);}
	public static void updateBranch(Branch branch, AsyncCallback<Integer> callback){commonControllerAsync.updateBranch(branch, callback);}
	public static void deleteBranch(long key, AsyncCallback<Integer> callback){commonControllerAsync.deleteBranch(key, callback);}
	public static void findBranches(Branch cri, AsyncCallback<BranchDataListDTO> callback){commonControllerAsync.findBranches(cri, callback);}
	public static void getBranchViewLoadDTO(AsyncCallback<BranchViewLoadDTO> callback){commonControllerAsync.getBranchViewLoadDTO(callback);}
	//End Office
	
	//For Country
	public static void createCountry(Country country,AsyncCallback<Integer> callback) {commonControllerAsync.createCountry(country, callback);}
	public static void updateCountry(Country country,AsyncCallback<Integer> callback) {commonControllerAsync.updateCountry(country, callback);}
	public static void deleteCountry(long countryId,AsyncCallback<Integer> callback) {commonControllerAsync.deleteCountry(countryId, callback);}
	public static void findCountry(Country cri,AsyncCallback<CountryDataListDTO> callback) {commonControllerAsync.findCountry(cri, callback);}
	public static void findCountryByCode(Country entity, AsyncCallback<Country> Callback) {commonControllerAsync.findCountryByCode(entity, Callback);}
	// Report
	public static void prepareCountryReport(CountryRpt info,AsyncCallback<Integer> callback){commonControllerAsync.prepareCountryReport(info, callback);}
    //End Country
	
	// Branch Type
	public static void createBranchType(BranchType branchType, AsyncCallback<Integer> callback) {
		commonControllerAsync.createBranchType(branchType, callback);
	}
	public static void updateBranchType(BranchType branchType, AsyncCallback<Integer> callback) {
		commonControllerAsync.updateBranchType(branchType, callback);
	}
	public static void deleteBranchType(long bankId, AsyncCallback<Integer> callback) {
		commonControllerAsync.deleteBranchType(bankId, callback);
	}
	public static void findBranchTypes(BranchType cri,AsyncCallback<BranchTypeDataListDTO> callback) {
		commonControllerAsync.findBranchTypes(cri, callback);
	}
	public static void findBranchTypeByCode(BranchType entity, AsyncCallback<BranchType> callback) {
		commonControllerAsync.findBranchTypeByCode(entity, callback);
	}
	public static void prepareBranchTypeReport(BranchTypeRpt info,AsyncCallback<Integer> callback) {
		commonControllerAsync.prepareBranchTypeReport(info, callback);
	}
	//End Branch Type

	
	//Branch
	public static void findBranchByCode(String code, AsyncCallback<Branch> callback) {commonControllerAsync.findBranchByCode(code, callback);}
	public static void prepareBranchReport(BranchRpt info,AsyncCallback<Integer> callback) {commonControllerAsync.prepareBranchReport(info, callback);}
	//End Branch
	
	public static void heartBeat(Date latestDateTime, AsyncCallback<Integer> callback){commonControllerAsync.heartBeat(latestDateTime, callback);}
}
